package com.sprinboot.controller;

import com.sprinboot.service.AccountService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by weiyonghua on 2017/7/15.
 */
@RestController
@RequestMapping("/account")
public class AccountController {
    @Autowired
    AccountService accountService;

    @RequestMapping("/transfer")
    public String transfer() {
        try {
            this.accountService.transfer();
        } catch (RuntimeException e) {
            return e.getMessage();
        }
        return "success";
    }
}
